<template>
  <div style="margin-bottom: 0.5rem;">


  <el-form :inline="true">
    <el-tooltip class="item" effect="dark" content="添加" placement="top" v-show="showAdd||showAll">
      <el-button type="info" icon="el-icon-plus" plain @click="addData" size="small" :disabled="addDisable"></el-button>
    </el-tooltip>
    <el-tooltip class="item" effect="dark" content="批量导入" placement="top" v-show="showMultiple||showAll">
      <el-button type="success" icon="el-icon-upload2" size="small" plain @click="addBatchData"></el-button>
    </el-tooltip>
    <el-tooltip class="item" effect="dark" content="删除" placement="top" v-show="showDelete||showAll">
      <el-button type="danger" icon="el-icon-delete" size="small" plain @click="deleteData" :disabled="deleteDisable"></el-button>
    </el-tooltip>
    <el-tooltip class="item" effect="dark" content="编辑" placement="top" v-show="showEdit||showAll">
      <el-button type="warning" icon="el-icon-edit" size="small" plain @click="updateData" :disabled="updateDisable"></el-button>
    </el-tooltip>
  </el-form>
  </div>
</template>

<script>

export default {
  props: {
    showAdd: {
      type: Boolean,
      default: true
    },
    showEdit: {
      type: Boolean,
      default: true
    },
    showMultiple: {
      type: Boolean,
      default: true
    },
    showDelete: {
      type: Boolean,
      default: true
    },
    showAll: {
      type: Boolean,
      default: true
    },
    isOperated: {
      type: Boolean,
      default: true
    },
    updateData: {
      type: Function
    },
    addData: {
      type: Function
    },
    selectData: {
      type: Function
    },
    deleteData: {
      type: Function
    },
    addBatchData: {
      type: Function
    },
    addDisable: {
      type: Boolean,
      default: false
    },
    deleteDisable: {
      type: Boolean,
      default: true
    },
    updateDisable: {
      type: Boolean,
      default: true
    }
  },
  name: "ToolBar",
  data() {
    return {
      operated: false,
    }
  },
  watch: {
    isOperated: function () {
      this.operated = this.isOperated
    }
  },
  methods: {}
}
</script>

<style scoped>

</style>
